﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ww="clr-namespace:WEAK.Windows.Windows">
    <Style TargetType="{x:Type ww:ZoomControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ww:ZoomControl}">
                    <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                        <ContentControl Content="{TemplateBinding Content}" Background="Transparent"
                                    HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalAlignment}">
                            <ContentControl.LayoutTransform>
                                <ScaleTransform ScaleX="{Binding Zoom, RelativeSource={RelativeSource FindAncestor, AncestorType=ww:ZoomControl}, FallbackValue=1}"
                                            ScaleY="{Binding Zoom, RelativeSource={RelativeSource FindAncestor, AncestorType=ww:ZoomControl}, FallbackValue=1}"/>
                            </ContentControl.LayoutTransform>
                        </ContentControl>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>